package com.hotdog.service;

import com.hotdog.mapper.TbWatchLogsMapper;
import com.hotdog.pojo.TbWatchLogs;
import com.hotdog.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * (TbWatchLogs)表服务实现类
 *
 * @author makejava
 * @since 2021-09-11 14:30:55
 */
@Service
public class TbWatchLogsServiceImpl implements TbWatchLogsService {
    @Autowired
    private TbWatchLogsMapper tbWatchLogsMapper;

    @Override
    @Transactional
    public SysResult insertLogs(TbWatchLogs tbWatchLogs) {
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        tbWatchLogs.setUsername(name);
        tbWatchLogsMapper.insert(tbWatchLogs);



        return SysResult.success();
    }
}

